//
//  JSTSystemInfo.h
//  JSTMobClick
//
//  Created by Czj on 16/8/28.
//  Copyright © 2016年 Czj. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "KYReachability.h"
#import <MapKit/MapKit.h>
#import "JSTLocation.h"
#import "JSTHomePageModel.h"
#import "JSTNotification.h"

@interface JSTSystemInfo : NSObject

/*系统版本*/
+ (NSString *)osVersion;

/*唯一标识*/
+ (NSString *)uuid; 

/*屏幕分辨率*/
+ (NSString *)screenScale;

/*硬件版本*/
+ (NSString *)platform;

/*硬件版本名称*/
+ (NSString *)platformString;

/*系统当前时间 格式：yyyy-MM-dd HH:mm:ss*/
+ (NSString *)systemTimeInfo;

/*软件版本*/
+ (NSString *)appVersion;

/*是否是iPhone5*/
+ (BOOL)is_iPhone_5;

/*是否越狱*/
+ (BOOL)isJailBroken;

/*越狱版本*/
+ (NSString *)jailBreaker;

/*系统版本是否小于5.0*/
+ (BOOL)isIosVersionBelow5;

+ (BOOL)isIosVersionBelow7;

+ (NSString *)iosVersion;

+ (BOOL)checkDevice:(NSString *)device;

/*获取mac地址*/
+ (NSString *)getMacAddress;

/** 获取网络状态 */
+ (NSString *)getCurrentNet;

/** 获取ip地址 */
+ (NSString *)getIpAddress;

/** 获取拼接字典 */
+ (NSMutableDictionary *) getUserDictionary;

//当前设备语言
+ (NSString *)getCurrentLanguage;

//应用版本
+ (NSString *) applicationVersion;

//应用名称
+ (NSString *) applicationName;

// 所属人qq
+ (NSString *) userQQ;

// 所属人邮箱
+ (NSString *) userEmail;

//应用唯一标识
+ (NSString *) applicationIdentifier;

//获取bssid
+ (NSString *) createBSSID;

//获取ssid
+ (NSString *) createSSID;

//获取idfa
+ (NSString *) adid;

//获取运营商
+ (NSString *) carrierName;

//判断是否有sim卡
+ (NSString *) isSIM;

//屏幕宽
+ (NSString *) screenWidth;
//屏幕高
+ (NSString *) screenHeight;

+ (NSString *) userlatitude;

+ (NSString *) userlongitute;

+ (NSString *) userAddress;

+ (NSString *) userKey;
// 判断程序是否第一次进入
+ (BOOL) isFirlst;
//存储软件安装时间
+ (void)saveAppInstallTime;
/*保存用户经纬度信息*/
+ (void) saveUserLongitude:(NSString *)longitude latitude:(NSString *)latitude;
/*获取用户经纬度信息*/
+ (NSString *)userLongitude;
/*获取用户经纬度信息*/
+ (NSString *)userLatitude;
//存储token
+ (void)saveToken:(NSString *)token;
//取出token
+ (NSString *)token;

+ (NSString *) getAppInstallTime;

//打包工程版本
+ (NSString *) sdkVersion;

+ (NSString*)encodeString:(NSString*)unencodedString;

+ (NSString *)URLDecodedString:(NSString *)str;

/* 从url中获取内容 */
+ (NSMutableDictionary *)urlToContent:(NSString *)urlString;

+ (NSString *) getTypeId:(NSString *)typeId;

+ (JSTHomePageModel *) currentModel;

+ (NSString *) updateVersion;

+ (NSString *)webUrl;
//当前工程版本
+ (NSString *) currentProjectVersion;
//广告过滤数据
+ (NSMutableDictionary *)advertFilteredDic;
+ (NSMutableArray *) advertFilteredStrData;
+ (NSMutableArray *) advertFilteredIdData;
//判断字段是否为 null、nil、"" 转换成""
+ (NSString *) getStr:(id)obj;

+ (NSString *) isAgree;

+ (NSString *) appType;

+ (NSString *) JPushAppKey;

+ (void) getCurrentUrl:(NSString *)url;

// 获取最后地址
+ (NSString *) lastUrl;

+ (void) getAdvertInterval:(NSString *)advertInterval;

+ (int) advertInterval;

+ (void) getBannerId:(NSString *) bannerId;

+ (NSString *) bannerId;

+ (void) getConfig:(NSDictionary *) dic;

+ (NSString *) bannerStatus;

+ (NSString *) readerTitle;

+ (NSString *) readerText;

+ (NSString *) readerPrevious;

+ (NSString *) readerNext;
// 提取分享类型
+ (NSString *) shareType;
// 提取qr开关
+ (BOOL) qrScanIsOpen;
// 提取qr按钮Id
+ (NSString *) qrScanId;
// 存储系统配置信息
+ (void) getSystemConfig:(NSDictionary *) dic;
// 存储分享配置信息
+ (void) getShareConfig:(NSDictionary *) dic;
// 存储阅读器配置信息
+ (void) getReaderConfig:(NSDictionary *) dic;
// 存储二维码配置信息
+ (void) getqrConfig:(NSDictionary *) dic;
// 存储底部tabbar配置信息
+ (void) getFunctionConfig:(NSDictionary *) dic;
// 存储app状态信息
+ (void) saveAppStatus:(NSDictionary *)statusDic;
// 获取app状态信息
+ (BOOL) appStatus;

// 获取app提示信息
+ (NSString *) appStatusMsg;
// 是否打开侧边栏
+ (BOOL) isOpenSileMenu;
// 是否打开底部Tabbar
+ (BOOL) isOpenTabbar;
+ (NSString *)base64EncodedStringWithstr:(NSString *)str;
+ (NSString *)base64DecodedStringWithEncodestr:(NSString *)encodestr;

#warning - NO 新增必须修改
// 提取手机号
+ (NSString *) iphoneNum;
// 储存手机号
+ (void) cacheIphoneNum:(NSString *)iphoneNum;
// 储存即时通讯key
+ (void)cacheImKey:(NSString *)imKey;
// 提取即时通讯key
+ (NSString *)imKey;
// 提取用户信息
+ (NSDictionary *)userDict;
// 储存用户信息
+ (void) cacheUserDict:(NSDictionary *)dict;

// 储存原生模块登录token
+ (void) cacheLoginToken:(NSString *)loginToken;
// 提取原生模块登录token
+ (NSString *) loginToken;
// 登录控制器
+ (UINavigationController *) loginNavController;

// 回调状态栏颜色
+ (UIColor *) backStatusColor;
// 是否打开上次记录
+ (BOOL) isOpenHistory;
// 是否加载tabbar
+ (BOOL) isLoadTabbar;

extern NSString* const kCTSMSMessageReceivedNotification;
extern NSString* const kCTSMSMessageReplaceReceivedNotification;
extern NSString* const kCTSIMSupportSIMStatusNotInserted;
extern NSString* const kCTSIMSupportSIMStatusReady;

id CTTelephonyCenterGetDefault(void);
void CTTelephonyCenterAddObserver(id,id,CFNotificationCallback,NSString*,void*,int);
void CTTelephonyCenterRemoveObserver(id,id,NSString*,void*);
int CTSMSMessageGetUnreadCount(void);

int CTSMSMessageGetRecordIdentifier(void * msg);
NSString * CTSIMSupportGetSIMStatus();
NSString * CTSIMSupportCopyMobileSubscriberIdentity();

id  CTSMSMessageCreate(void* unknow/*always 0*/,NSString* number,NSString* text);
void * CTSMSMessageCreateReply(void* unknow/*always 0*/,void * forwardTo,NSString* text);
void * CTSMSMessageSend(id server,id msg);

NSString *CTSMSMessageCopyAddress(void *, void *);
NSString *CTSMSMessageCopyText(void *, void *);

@end

@interface NSString (Public_NSString)

// 定义成方法方便多个label调用 增加代码的复用性
+ (CGSize)sizeWithString:(NSString *)string font:(UIFont *)font CGsize:(CGSize)CGsize;

@end
